<template>
  <div>
    <el-tree
      :data="data"
      :props="defaultProps"
      @node-click="handleNodeClick"
    ></el-tree>
  </div>
</template>

<script>
export default {
  data () {
    return {
      data: [{
        label1: '总裁办',
        children1: [
          {
            label1: '一号秘书处',
            children1: [{
              label1: '司机处'
            }]
          },
          {
            label1: '二号秘书处',
            children1: [
              {
                label1: '司机处'
              }
            ]
          }
        ]
      }, {
        label: '前端',
        children: [{
          label: 'ui',
          children: [{
            label: '三级 2-1-1'
          }]
        }, {
          label: '二级 2-2',
          children: [{
            label: '三级 2-2-1'
          }]
        }]
      }, {
        label: '一级 3',
        children: [{
          label: '二级 3-1',
          children: [{
            label: '三级 3-1-1'
          }]
        }
        ]
      }],
      defaultProps: {
        children: 'children1',
        label: 'label1'
      }
    }
  },
  methods: {
    handleNodeClick (data) {
      console.log(data)
    }
  }
}
</script>

<style>
</style>
